home *** CD-ROM | disk | FTP | other *** search
- package sun.tools.zip;
-
- import java.io.IOException;
- import java.io.InputStream;
-
- class ZipReaderInputStream extends InputStream implements ZipConstants {
- // $FF: renamed from: is java.io.InputStream
- private InputStream field_0;
- int count;
-
- ZipReaderInputStream(InputStream var1, ZipEntry var2) {
- this.field_0 = var1;
- this.count = (int)var2.length;
- }
-
- public int read(byte[] var1, int var2, int var3) throws IOException {
- if (this.count <= 0) {
- return -1;
- } else {
- int var4 = this.field_0.read(var1, var2, var3 > this.count ? this.count : var3);
- if (var4 == -1) {
- throw new IOException("Unexpected EOF");
- } else {
- this.count -= var4;
- return var4;
- }
- }
- }
-
- public int read() throws IOException {
- if (this.count <= 0) {
- return -1;
- } else {
- int var1 = this.field_0.read();
- if (var1 == -1) {
- throw new IOException("Unexpected EOF");
- } else {
- --this.count;
- return var1;
- }
- }
- }
-
- public long skip(long var1) throws IOException {
- if (this.count <= 0) {
- return 0L;
- } else {
- var1 = this.field_0.skip(var1 > (long)this.count ? (long)this.count : var1);
- this.count = (int)((long)this.count - var1);
- return var1;
- }
- }
-
- public int available() throws IOException {
- int var1 = this.field_0.available();
- return var1 > this.count ? this.count : var1;
- }
- }
-